package gov.tax.rti.base.security.entity;

import gov.tax.rti.core.security.entity.FunctionTag;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

/**
 * 功能标签
 * 
 * @since 2013年11月6日
 * @author jimmy.li
 * @version 1.00 2013年11月6日
 */
@Entity
@Table(name = "RTI_GNBQ")
public class Gnbq extends BaseTag implements FunctionTag{
	/**
	 * 
	 */
	private static final long serialVersionUID = -7664682773812890148L;
	private String qdzl;
	private String qdcs;
	private String parentId;
	private int order;//TODO 排序字段为字符，长度16，暂时先按数字处理
	private List<FunctionTag> children;
	private String model;
	
	@Id
	@GeneratedValue(generator = "guid")
	@GenericGenerator(name = "guid", strategy = "guid")
	@Column(name = "GNBQ_DM", unique = true, nullable = false, length = 32)
	public String getGnbqDm() {
		return super.getDm();
	}
	
	public void setGnbqDm(String gnbqDm) {
		super.setDm(gnbqDm);
	}
	
	@Column(name = "GNBQ_SX", nullable = false, length = 8)
	public String getGnbqSx() {
		return super.getSx();
	}
	
	public void setGnbqSx(String gnbqSx) {
		super.setSx(gnbqSx);
	}
	
	@Column(name = "QDZL", length = 256)
	public String getQdzl() {
		return qdzl;
	}

	public void setQdzl(String qdzl) {
		this.qdzl = qdzl;
	}
	
	@Column(name = "QDCS", length = 256)
	public String getQdcs() {
		return qdcs;
	}

	public void setQdcs(String qdcs) {
		this.qdcs = qdcs;
	}
	
	@Column(name = "GNBQ_BM", nullable = false, length = 32)
	public String getGnbqBm() {
		return super.getBm();
	}
	
	public void setGnbqBm(String gnbqBm) {
		setBm(gnbqBm);
	}
	
	@Column(name = "GNBQ_MC", nullable = false, length = 96)
	public String getGnbqMc() {
		return super.getMc();
	}
	
	public void setGnbqMc(String gnbqMc) {
		setMc(gnbqMc);
	}
	
	@Column(name = "GNBQ_SY", length = 16)
	public String getGnbqSy() {
		return super.getSy();
	}
	
	public void setGnbqSy(String gnbqSy) {
		setSy(gnbqSy);
	}
	
	/*@Column(name = "XZB", nullable = false,precision = 5,scale = 0)
	public int getXzb() {
		return xzb;
	}
	
	public void setXzb(int xzb) {
		this.xzb = xzb;
	}
	
	@Column(name = "YZB", nullable = false,precision = 5,scale = 0)
	public int getYzb() {
		return yzb;
	}
	public void setYzb(int yzb) {
		this.yzb = yzb;
	}
	
	@Column(name = "GNMX_DM", nullable = false, length = 32)
	public String getGnmxDm() {
		return this.mxDm;
	}

	public void setGnmxDm(String gnmxDm) {
		this.mxDm = gnmxDm;
	}*/

	@Transient
	@Override
	public String getParentId() {
		return parentId;
	}

	@Override
	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	@Transient
	@Override
	public String getUrl() {
		return qdzl;
	}

	@Override
	public void setUrl(String url) {
		this.qdzl = url;
	}

	@Transient
	@Override
	public int getOrder() {
		return order;
	}

	@Override
	public void setOrder(int order) {
		this.order = order;
	}

	@Transient
	@Override
	public List<FunctionTag> getChildren() {
		if(this.children == null){
			this.children = new ArrayList<FunctionTag>();
		}
		return this.children;
	}

	@Override
	public void setChildren(List<FunctionTag> children) {
		this.children = children;
	}
	
	@Transient
	@Override
	public String getModel() {
		return this.model;
	}

	@Override
	public void setModel(String model) {
		this.model = model;
	}
}
